/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language2;

import java.util.Collection;

import ac.jp.u_tokyo.SyncLib.language.EvaluationFailedException;
import ac.jp.u_tokyo.SyncLib.language.GraphCombinatorBody;

public class VarExprPart extends Part {
	VarExpr _expr;
	boolean _atLeft;
	
	public VarExprPart(VarExpr expr, boolean atLeft)
	{
		super();
		_expr = expr;
		_atLeft = atLeft;
	}

	@Override
	public void addBody(GraphCombinatorBody body,
			Collection<String> genericParas, Var var) throws EvaluationFailedException
	{
		_expr.addBody(var, _atLeft, body, genericParas);
	}

	@Override
	public Var getConnectionVar(Collection<String> genericParas)
	{
		return null;
	}
	
	@Override
	public Collection<Var> getVarUsed(Collection<String> genericParas)
			throws EvaluationFailedException
	{
		return _expr.getVarUsed(genericParas);
	}

	public void setAtLeft(boolean b)
	{
		_atLeft = false;
		
	}

}